﻿<%@ Control Language="C#" AutoEventWireup="true" CodeBehind="Relationship.ascx.cs" Inherits="PayrollHR.Administration.Modules.RelationshipControl" %>
<%@ Register Src="ConfirmationBox.ascx" TagName="ConfirmationBox" TagPrefix="uc2" %>
<%@ Register Src="ToolTipLabelControl.ascx" TagName="ToolTipLabelControl" TagPrefix="uc1" %>
<script type="text/javascript">
    function showstuff(boxid) {
        document.getElementById(boxid).style.display = "block";
    }

    function hidestuff(boxid) {
        document.getElementById(boxid).style.display = "none";
    }
</script>
<asp:UpdatePanel ID="upForumSubscriptions" runat="server">
    <ContentTemplate>
        <div class="section-header">
            <div class="title">
                <img src="Common/ico-customers.png" alt="Admin.Customers.ManagerCustomer" />
                <%=GetLocaleResourceString("Admin.ListCustomerType.RelationshipsList")%>
            </div>
            <div class="options">
                <input type="button" onclick="showstuff('AddRelationship');" value="Filter add Relationship"
                    id="btnAddNew" class="adminButtonBlue" title="Add Relationship" />
            </div>
        </div>
        <div id="AddRelationship" style="display: none;" class="title">
            <div>
                <table style="width: auto">
                    <tr>
                        <td class="adminTitle">
                            <uc1:ToolTipLabelControl runat="server" ID="ToolTipLabelControl1" Text="<% $PayrollResources:admin.customerinfo.custtype.text %>" ToolTip="<% $PayrollResources:admin.customerinfo.custtype.text %>"
                                ToolTipImage="~/Administration/Common/ico-help.gif" />
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlCustType" CssClass="adminInput" runat="server" AutoPostBack="false">
                            </asp:DropDownList>
                        </td>
                        <td class="adminTitle">
                            <uc1:ToolTipLabelControl runat="server" ID="ToolTipLabelControl2" Text="<% $PayrollResources:admin.CustomerSearchControl.national.Text %>" ToolTip="<% $PayrollResources:admin.CustomerSearchControl.national.Text %>"
                                ToolTipImage="~/Administration/Common/ico-help.gif" />
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlNational" CssClass="adminInput" runat="server" AutoPostBack="false">
                            </asp:DropDownList>
                        </td>
                        <td class="adminTitle">
                            <uc1:ToolTipLabelControl runat="server" ID="ToolTipLabelControl3" Text="<% $PayrollResources:admin.CustomerSearchControl.DayCaseword.Text %>" ToolTip="<% $PayrollResources:admin.CustomerSearchControl.DayCaseword.Text %>"
                                ToolTipImage="~/Administration/Common/ico-help.gif" />
                        </td>
                        <td>
                            <asp:DropDownList ID="ddlYear" runat="server" AutoPostBack="false">
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddlMonth" runat="server" AutoPostBack="false">
                            </asp:DropDownList>
                        </td>
                    </tr>
                    <tr id="row1">
                        <td class="adminTitle">
                            <uc1:ToolTipLabelControl runat="server" ID="lblChannelTitle" Text="<% $PayrollResources:Admin.CustomerSearch.CustName.Text %>" ToolTip="<% $PayrollResources:Admin.CustomerSearch.CustName.ToolTip %>"
                                ToolTipImage="~/Administration/Common/ico-help.gif" />
                        </td>
                        <td class="adminData">
                            <asp:TextBox ID="txtCustomerName" CssClass="adminInput" runat="server"></asp:TextBox>
                        </td>
                        <td class="adminTitle">
                            <uc1:ToolTipLabelControl ID="lblCustCaseWork" runat="server" Text="<% $PayrollResources:Admin.CustomerInfo.CustomerSearch.Text %>"
                                ToolTip="<% $PayrollResources:Admin.CustomerInfo.CustomerSearch.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
                        </td>
                        <td class="adminData">
                            <asp:TextBox ID="txtCustCaseWork" CssClass="adminInput" runat="server"></asp:TextBox>
                        </td>
                        <td class="adminTitle">
                            <uc1:ToolTipLabelControl ID="lblCustMobile" runat="server" Text="<% $PayrollResources:Admin.CustomerInfo.CustMobile.Text %>"
                                ToolTip="<% $PayrollResources:Admin.CustomerInfo.CustMobile.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
                        </td>
                        <td class="adminData">
                            <asp:TextBox ID="txtMobile" CssClass="adminInput" runat="server"></asp:TextBox>
                        </td>
                    </tr>
                    <tr>
                        <td class="adminTitle">
                            <uc1:ToolTipLabelControl ID="lblCustParent" runat="server" Text="<% $PayrollResources:Admin.CustomerInfo.CustParent.Text %>"
                                ToolTip="<% $PayrollResources:Admin.CustomerInfo.CustParent.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
                        </td>
                        <td class="adminData">
                            <asp:TextBox ID="txtCustParent" runat="server" CssClass="adminInput"></asp:TextBox>
                        </td>
                        <td class="adminTitle">
                            <uc1:ToolTipLabelControl ID="lblCustHour" runat="server" Text="<% $PayrollResources:Admin.CustomerInfo.CustHour.Text %>"
                                ToolTip="<% $PayrollResources:Admin.CustomerInfo.CustHour.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
                        </td>
                        <td class="adminData">
                            <asp:TextBox ID="txtCustHour" runat="server" CssClass="adminInput"></asp:TextBox>
                        </td>
                        <td class="adminTitle">
                            <uc1:ToolTipLabelControl ID="lblCustDateOfBirth" runat="server" Text="<% $PayrollResources:Admin.CustomerInfo.CustDateOfBirth.Text %>"
                                ToolTip="<% $PayrollResources:Admin.CustomerInfo.CustDateOfBirth.ToolTip %>" ToolTipImage="~/Administration/Common/ico-help.gif" />
                        </td>
                        <td class="adminData">
                            <asp:DropDownList ID="ddlYearOfBrirth" runat="server" AutoPostBack="false">
                            </asp:DropDownList>
                            <asp:DropDownList ID="ddlMonthOfBrirth" runat="server" AutoPostBack="false">
                            </asp:DropDownList>
                        </td>
                        <td class="adminTitle"></td>
                    </tr>
                </table>
            </div>
        </div>
        <asp:GridView ID="gvCustomerAdd" runat="server" AutoGenerateColumns="False" Width="100%" DataKeyNames="CustomerID" 
            AllowPaging="true"
            PageSize="10">
            <Columns>
                <asp:TemplateField  HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="2%" ItemStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:CheckBox ID="chkRow" runat="server" />
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="CaseWork"
                    HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="8%" ItemStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="lblCustCaseWork" runat="server" Text='<%# Bind("CustCaseWork") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Tên khách hàng"
                    HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="30%" ItemStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="lblCustName" runat="server" Text='<%# Bind("CustName") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Người phụ trách" ItemStyle-Width="10%">
                    <ItemTemplate>
                        <asp:Label ID="lblProCurator" runat="server" Text='<%# Eval("ProCurator") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Người tư vấn"
                    HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="12%" ItemStyle-HorizontalAlign="Center">
                    <ItemTemplate>
                        <asp:Label ID="lblCustCounselor" runat="server" Text='<%# Eval("CustCounselor") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
                <asp:TemplateField HeaderText="Mobile"
                    HeaderStyle-HorizontalAlign="Center" ItemStyle-Width="20%" ItemStyle-HorizontalAlign="Left">
                    <ItemTemplate>
                        <asp:Label ID="lblCustMobile" runat="server" Text='<%# Eval("CustMobile") %>'></asp:Label>
                    </ItemTemplate>
                </asp:TemplateField>
            </Columns>
            <PagerSettings PageButtonCount="50" Position="TopAndBottom" />
        </asp:GridView>
        <div style="text-align: center; padding-top: 5px;" class="options">
            <asp:Button ID="btnSearch" runat="server" Text="Filter" OnClick="btnSearch_Click" OnClientClick="showstuff('AddRelationship');" CssClass="adminButtonBlue" ToolTip="Filter" />
            <asp:Button ID="btnOk" runat="server" Text="Ok"
                CssClass="adminButtonBlue" ToolTip="Ok" OnClick="btnOk_Click" OnClientClick="hidestuff('AddRelationship');" />
        </div>
        <p>
            <div class="section-header">
                <div class="title">
                    <img src="Common/ico-customers.png" alt="Admin.Customers.ManagerCustomer" />
                    Danh sach được chọn
                </div>                
            </div>
            <p>
            </p>
            <asp:GridView ID="gvCustomerRelationship" runat="server" AutoGenerateColumns="False" DataKeyNames="RelationshipID,CustomerID" PageSize="12" Width="100%" OnRowDeleting="gvCustomerRelationship_RowDeleting">
                <Columns>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="CaseWork" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="8%">
                        <ItemTemplate>
                            <asp:HyperLink ID="ActionHyperLink" runat="server" ToolTip="Click vào tên khách hàng để xem chi tiết" Text='<%# Eval("CustCaseWork") %>' NavigateUrl='<%# String.Format("../CustomerAdd.aspx?CustomerId={0}", Eval("CustomerID")) %>'  />                                  
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Tên khách hàng" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="30%">
                        <ItemTemplate>
                            <asp:HyperLink ID="caseworkHyperLink" runat="server"  ToolTip="Click vào Casework để xem chi tiết" Text='<%# Eval("CustName") %>' NavigateUrl='<%# String.Format("../CustomerAdd.aspx?CustomerId={0}", Eval("CustomerID")) %>'  />                        
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderText="Người phụ trách" ItemStyle-Width="10%">
                        <ItemTemplate>
                            <asp:Label ID="lblProCurator" runat="server" Text='<%# Eval("ProCurator") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Người tư vấn" ItemStyle-HorizontalAlign="Center" ItemStyle-Width="12%">
                        <ItemTemplate>
                            <asp:Label ID="lblCustCounselor" runat="server" Text='<%# Eval("CustCounselor") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:TemplateField HeaderStyle-HorizontalAlign="Center" HeaderText="Mobile" ItemStyle-HorizontalAlign="Left" ItemStyle-Width="20%">
                        <ItemTemplate>
                            <asp:Label ID="lblCustMobile" runat="server" Text='<%# Eval("CustMobile") %>'></asp:Label>
                        </ItemTemplate>
                    </asp:TemplateField>
                    <asp:CommandField ShowDeleteButton="True" HeaderStyle-HorizontalAlign="Center" HeaderText="Delete" ItemStyle-HorizontalAlign="Center" ButtonType="Button" />
                </Columns>
            </asp:GridView>           
        </p>
    </ContentTemplate>
</asp:UpdatePanel>
